package com.wqtz.chechai.presenter;

import android.content.Context;

import com.orhanobut.logger.Logger;
import com.wqtz.chechai.bean.CarInfo;
import com.wqtz.chechai.model.CarInfoModel;
import com.wqtz.chechai.view.impl.ICarInfoImpl;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/22 9:31
 */

public class NewAddCarInfoPresenter extends BasePresent {
    ICarInfoImpl mICarInfo;
	CarInfo mCarInfo  ;

	public NewAddCarInfoPresenter(ICarInfoImpl ICarInfo) {
		mICarInfo = ICarInfo;
	}


	@Override
	public void loadData(Context context, String... args) {
		mCarInfo = new CarInfo();
		mCarInfo =CarInfoModel.getCarInfo(args[0]);
		if(mICarInfo!=null){
			//数据请求成功
			mICarInfo.showCarInfo(mCarInfo);
			Logger.e(mCarInfo.toString());
		}else {
			//数据请求失败
			mICarInfo.showError("网络错误",404);
		}

	}
}
